package cn.liumouren.tool.security.core;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * 选择实现{@link WebMvcConfigurer}而不选择{@link org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport}的原因
 *
 * <p>实现{@link org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport}会使mvc自动装配
 * {@link org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration}失效
 *
 * @author Daniel Liu
 * @date 2021/3/12 16:03
 */
public abstract class DlInterceptorRegistry implements WebMvcConfigurer, InitializingBean {
    /**
     * 所有的 DlInterceptor
     */
    private List<DlInterceptor> interceptors;

    @Override
    public void afterPropertiesSet() throws Exception {

    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    }

    public List<DlInterceptor> getInterceptors() {
        return interceptors;
    }

    public void setInterceptors(List<DlInterceptor> interceptors) {
        this.interceptors = interceptors;
    }
}
